<template>
  <div>
    <keep-alive>
      <component v-bind:is="currentTabComponent" @switchComponent="handleSwitchComponent" :obj="obj"></component>
    </keep-alive>
  </div>
</template>
<script>
export default {
  name:'async-component',
  data(){
    return {
      currentTabComponent:'scheduling',
      obj:{}
    }
  },
  mounted(){

  },
  components:{
    scheduling:()=>import('@/business/baseinfo/scheduling/list'),
    assign:()=>import('@/business/baseinfo/scheduling/assign'),
    strategy:()=>import('@/business/baseinfo/scheduling/strategy'),
    batchAssign:()=>import('@/business/baseinfo/scheduling/batchAssign')
  },
  methods:{
    handleSwitchComponent(obj){
      //console.log(obj)
      this.obj=obj
      this.currentTabComponent = obj.componentName
    }
  }
}
</script>
<style lang="scss" scoped>

</style>